Skip to content

Added ESP:: functions for sketch size #2028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 19, 2018
Merged

Added ESP:: functions for sketch size #2028

merged 2 commits into from
Nov 19, 2018

Conversation

lbernstone
Copy link
Contributor

No description provided.

@lbernstone
Copy link
Contributor Author

Fixes #1707

@Jeroen88
Copy link
Contributor

Jeroen88 commented Nov 8, 2018

Nice, could you add getSketchMD5() too? Then I will incorprate these in my PR #1979 :)

@lbernstone
Copy link
Contributor Author

lbernstone commented Nov 8, 2018

@Jeroen88: Metadata for esp32 images includes SHA-256 hash. Is that useful?

@Jeroen88
Copy link
Contributor

Jeroen88 commented Nov 8, 2018

@lbernstone Before updating, the ESP client adds a header for the server with the MD5 of the sketch running. I think this header is not used much by servers, but I think that the idea was to give the server the opportunity to match the sketch currently running with data on the server for some business logic. To keep it compatible with the ESP8266, I do not need the MD5 of the sketch being downloaded, but the MD5 of the present sketch. That function is not available yet, is it?

@lbernstone
Copy link
Contributor Author

MD5 would have to be calculated, which would likely take a minute of 100% cpu and blocked SPI. SHA256 is stored in the metadata, and is directly available through an IDF function.

@Jeroen88
Copy link
Contributor

I double checked ESP8266HTTPUpdate and EspClass::getSketchMD5, and for the ESP8266 indeed the MD5 of the running sketch is added to the request headers. Also, it is computed on the fly, and not stored in some flash header or so, so at least for the ESP8266 it is fast enough.
To be compatible with the ESP8266 it would be better to add MD5, but my impression is that it is not used very often. A SHA-256 would be a good alternative then.
When I have some time, I will add skech size and SHA-256 to the HTTPUpdate class of PR #1979

@me-no-dev me-no-dev merged commit af79e18 into espressif:master Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants